@extends('default.mobile.layouts.personalPublic')
@section('title','基本信息-'.Site::get('webname'))
{{--首页css--}}
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/mobile/personal/common.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/mobile/jquery/select.css')}}">
    <link rel="stylesheet" type="text/css" href="{{asset('/vendor/webuploader/dist/webuploader_img.css')}}">
    <style>
        .webuploader-pick{ width:7.2rem; height: 1rem;}
    </style>
@endsection
{{--头部标签--}}
@section('tag','基本信息')
@section('link') href="{{url('mobile/personal/resume_manage?resume_id='.$resume->id)}}" @endsection

{{--主体内容--}}
@section('content')
    <div class="fill" id="fill" style="overflow: hidden">
        <div class="form_info" id="form_info">
            <form action="{{url('mobile/personal/resume_basic')}}" onsubmit="return checkBasic('#basicForm')" method="post" id="basicForm" name="basicForm">
                {{csrf_field()}}
                <input type="hidden" name="resume_id" id="resume_id"  value="{{$resume->id}}">
                <dl class="arrow"  id="avatar" >
                    <dt>简历照片</dt>
                    <dd class="avatar"  ><img src="{{$resume->avatar}}"/></dd>
                </dl>
                <dl>
                    <dt>姓名<span class="asterisk">*</span></dt>
                    <dd><input type="text" name="name" id="name"  value="{{$resume->name}}" placeholder="请输入姓名" autocomplete="off"></dd>
                </dl>
                <dl class="arrow" id="sex_select">
                    <input type="hidden" name="sex" value="{{$resume->sex}}" id="sex" />
                    <dt>性别<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择性别</span></dd>
                </dl>
                <dl class="arrow" id="birthday_select">
                    <input type="hidden" name="birthday" value="{{$resume->birthday}}" id="birthday" />
                    <dt>出生日期<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择出生日期</span></dd>
                </dl>
                <dl class="arrow" id="education_select">
                    <input type="hidden" name="education" value="{{$resume->education}}" id="education" />
                    <dt>最高学历<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择学历</span></dd>
                </dl>
                <dl>
                    <dt>详细地址</dt>
                    <dd><input type="text" name="address" id="address"  value="{{$resume->address}}" placeholder="请输入手机号码"  autocomplete="off"></dd>
                </dl>
                <dl class="arrow" id="work_year_select">
                    <input type="hidden" name="work_year" value="{{$resume->work_year}}" id="work_year" />
                    <dt>工作经验</dt>
                    <dd><span class="select_text">请选择工作经验</span></dd>
                </dl>
                <dl class="arrow" id="job_status_select">
                    <input type="hidden" name="job_status" value="{{$resume->job_status}}" id="job_status" />
                    <dt>求职状态<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择求职状态</span></dd>
                </dl>
                <dl class="arrow" id="homeaddress_select">
                    <input type="hidden" name="homeaddress" value="{{$resume->homeaddress}}" id="homeaddress" />
                    <dt>现居地<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择现居地</span></dd>
                </dl>
                <dl>
                    <dt>手机号码<span class="asterisk">*</span></dt>
                    <dd><input type="text" name="mobile" id="mobile"  value="{{$resume->mobile}}" placeholder="请输入手机号码"  autocomplete="off"></dd>
                </dl>
                <dl>
                    <dt>邮箱地址</dt>
                    <dd><input type="text" name="email" id="email"  value="{{$resume->email}}" placeholder="请输入邮箱地址"  autocomplete="off"></dd>
                </dl>
                <dl class="arrow" id="census_select">
                    <input type="hidden" name="census" value="{{$resume->census}}" id="census" />
                    <dt>户籍地址<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择户籍地址</span></dd>
                </dl>
                <dl class="arrow" id="marital_select">
                    <input type="hidden" name="marital" value="{{$resume->marital}}" id="marital" />
                    <dt>婚姻状况</dt>
                    <dd><span class="select_text">请选择婚姻状况</span></dd>
                </dl>
                <dl>
                    <dt>身高</dt>
                    <dd><input type="text" name="height" id="height" value="{{$resume->height}}" placeholder="请输入身高"  autocomplete="off"></dd>
                </dl>
                <div class="form_sub"><input type="submit" value="保存"></div>
            </form>
        </div>
    </div>
@endsection
@section('footerjs')
    @parent
    <script type="text/javascript" src="{{asset('/vendor/webuploader/dist/webuploader.html5only.min.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/personal/upavatar.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/iscroll.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select_single.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select_time.js')}}"></script>
    <script type="text/javascript" src="{{Resources::jsOption('resume')}}"></script>
    <script type="text/javascript" src="{{Resources::jsProvinceArea()}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/personal/resume_manage.js')}}"></script>
    <script>
        var _token =  '{{csrf_token()}}';
        uploadAvatar('#avatar');
        $(function(){
            var fill = $("#fill").find('#form_info');
            //工作经验
            fill.find("#work_year_select").select({
                select_title:'工作经验',                //标题值
                hidden: '#work_year',                   //select隐藏表单值
                opt_data:option_work_year               //select选项值（数组json对象）
            });
            //性别
            var option_sex = [{text:'男',value:1},{text:'女',value:2}];
            fill.find("#sex_select").select({
                select_title:'性别',
                hidden: '#sex',
                opt_data:option_sex
            });

            //出生日期
            fill.find("#birthday_select").select_time({
                select_title:'出生日期',
                hidden: '#birthday'
//                toDate:true
            });

            //学历
            fill.find("#education_select").select({
                select_title:'最高学历',
                hidden: '#education',
                opt_data:option_education
            });

            //求职状态
            fill.find("#job_status_select").select({
                select_title:'求职状态',
                hidden: '#job_status',
                opt_data:option_job_status
            });

            //婚姻状况
            fill.find("#marital_select").select({
                select_title:'婚姻状况',
                hidden: '#marital',
                opt_data:option_marital
            });
            //县级市
            //单列选项地区选择
            fill.find("#homeaddress_select").select_single({
                select_title:'现居地',
                hidden: '#homeaddress',
                opt_city: (typeof(option_city) != 'undefined') ? option_city : [],
                opt_province:option_province
            });

            //单列户籍地区选择
            fill.find("#census_select").select_single({
                select_title:'户籍',
                hidden: '#census',
                opt_city: (typeof(option_city) != 'undefined') ? option_city : [],
                opt_province:option_province
            });
        });

        //错误信息提示
        @if(count($errors)>0)
            @if(is_object($errors))
                var msgErr='';
                @foreach($errors->all() as $error)
                    msgErr += "<p style='line-height: .4rem; width: 100%'>{{$error}};</p>";
                @endforeach
                layerMsg(msgErr,2);
            @endif
        @endif
    </script>
@endsection